﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using OnTheWay.Functions;
using LocalService;
using Models;
using OnTheWay.Interfaces;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace PcBackgroundMgr.Functions
{
    /// <summary>
    /// ExhibitTypeListCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class ExhibitTypeListCtrl : ExhibitTypeListCtrlBase
    {
        public ExhibitTypeListCtrl()
        {
            InitializeComponent();
        }


    }

    [DesignTimeVisible(false)]
    public class ExhibitTypeListCtrlBase : FunctionCtrlList<ExhibitType>
    {
        public ExhibitTypeListCtrlBase()
            : this(LocalFactory.ExhibitTypeLocal)
        {
        }

        public ExhibitTypeListCtrlBase(IObjectBasicBehaviors<ExhibitType, Guid> domain)
            : base(domain, typeof(ExhibitTypeModelCtrl))
        {
        }

        protected override void OnCommandRefreshFail(Exception ex)
        {
            ObservableCollection<ExhibitType> items = new ObservableCollection<ExhibitType>();
            items.Add(new ExhibitType() { Name = "测试数据1" });
            items.Add(new ExhibitType() { Name = "测试数据2" });
            items.Add(new ExhibitType() { Name = "测试数据3" });
            items.Add(new ExhibitType() { Name = "测试数据4" });
            items.Add(new ExhibitType() { Name = "测试数据5" });
            items.Add(new ExhibitType() { Name = "测试数据6" });
            items.Add(new ExhibitType() { Name = "测试数据7" });
            items.Add(new ExhibitType() { Name = "测试数据8" });
            items.Add(new ExhibitType() { Name = "测试数据9" });
            items.Add(new ExhibitType() { Name = "测试数据0" });
            items.Add(new ExhibitType() { Name = "测试数据1" });
            DispatchItems = items;
        }
    }
}
